package com.tony.activotytest;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class SecondActivity extends BaseActivity {

    private Button button2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);

        // 接受参数
//        Intent intent = getIntent();
//        String data = intent.getStringExtra("Data");
//        Log.d("SecondActivity",data);

        initView();

    }

    public void initView(){
        button2 = findViewById(R.id.button2);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //反向传值
                Intent intent = new Intent();
                intent.putExtra("data_return","hello MainActivity1111");
                setResult(RESULT_OK,intent);
                finish();
            }
        });

    }



}